#//#!/bin/bash
#//
#//a=10
#//b=3
#//
#//# 加法
#//echo "$a + $b = $((a + b))"
#//
#//# 减法
#//echo "$a - $b = $((a - b))"
#//
#//# 乘法
#//echo "$a * $b = $((a * b))"
#//
#//# 除法
#//echo "$a / $b = $((a / b))"
#//
#//# 取余
#//echo "$a % $b = $((a % b))"

##!/bin/bash 
#a=10
#b=5
#
#if [ $a -eq $b ]; then
#	echo "$a is equal to $b"
#else 
#	echo "$a is not equal to $b"
#fi
#
#if [ $a -gt $b ] ;then
#	echo "$a is greater than $b"
#fi

##!/bin/bash
#a=10
#b=5
#c=20
#
#if [ $a -gt $b ] && [ $a -lt $c ]; then
#    echo "$a is greater than $b and less than $c"
#fi
#
#if [ $a -gt $b ] || [ $a -gt $c ]; then
#    echo "$a is either greater than $b or greater than $c"
#fi
#
#
#



##!/bin/bash 
#str1="hello"
#str2="world"
#
#if [ "$str1" = "$str2" ]; then
#	echo "string are equal"
#else 
#	echo "string are not equal"
#fi
#
#if [ -z"$str1" ]; then
#	echo "string is empty"
#else 
#	echo "string is not empty"
#fi
#
#
#
#
#

##!/bin/bash
#file="/etc/passwd"
#
#if [ -e $file ]; then
#	echo "$file exists"
#fi
#
#if [ -f $file ]; then
#	echo "$file id a regular file"
#fi
#
#if [ -d $file ]; then
#	echo "$file is a directory"
#else
#	echo "$file is not a directory"
#fi
#


##!/bin/bash
#echo "Hello,world" > output.txt
#echo "append this line" >> output.txt
#cat < output.txt
#
#echo "Hello,world" | tr 'a-z' 'A-Z'

##!/bin/bash
#var="Shell"
#
#echo "The value of var is:${var}"
#
#echo "Value:${emptyVar:-defaultValue};
#
#emptyVar=""
#echo "Value agter assignment: ${emptyVar:=defaultValue}"
#
#echo "Alternative: ${var:+alternativeValue}"
#

#!/bin/bash
var="Shell"

echo "The value of var is: ${var}"

# 如果var为空，使用默认值
echo "Value: ${emptyVar:-defaultValue}"

# 如果emptyVar为空，赋予默认值
emptyVar=""
echo "Value after assignment: ${emptyVar:=defaultValue}"

# 如果emptyVar不为空，使用替代值
echo "Alternative: ${var:+alternativeValue}"

